const routes = [
  {
    path: "/login-register",
    component: () => import("@/views/login-register/index.vue"),
    meta: { title: "登录/注册", requiresAuth: false, isShowNav: false },
  },
  {
    path: "/",
    redirect: "/index",
    component: () => import("@/views/index.vue"),
    meta: { isShowNav: false },
    children: [
      {
        path: "/index",
        component: () => import("@/views/home/index.vue"),
        meta: { title: "首页", requiresAuth: true, isShowNav: true },
      },
      {
        path: "/clientmanage",
        redirect: "/clientmanage/usermanage",
        component: () => import("@/views/manage/clientM/index.vue"),
        meta: {
          title: "用户管理",
          menu: "用户管理列表目录",
          requiresAuth: true,
          isShowNav: true,
        },
        children: [
          {
            path: "usermanage",
            component: () => import("@/views/manage/clientM/client/index.vue"),
            meta: {
              title: "玩家管理",
              requiresAuth: true,
              isShowNav: true,
            },
          },
          {
            path: "vendormanage",
            component: () => import("@/views/manage/clientM/vendor/index.vue"),
            meta: {
              title: "开发者管理",
              requiresAuth: true,
              isShowNav: true,
            },
          },
          {
            path: "adminmanage",
            component: () => import("@/views/manage/clientM/admin/index.vue"),
            meta: {
              title: "平台管理员",
              requiresAuth: true,
              isShowNav: true,
            },
          },
        ],
      },
      {
        path: "/gamemanage",
        redirect: "/gamemanage/gamelist",
        component: () => import("@/views/manage/gameM/index.vue"),
        meta: {
          title: "游戏管理",
          menu: "游戏管理列表目录",
          requiresAuth: true,
          isShowNav: true,
        },
        children: [
          {
            path: "gamelist",
            component: () => import("@/views/manage/gameM/gameList/index.vue"),
            meta: {
              title: "游戏列表",
              requiresAuth: true,
              isShowNav: true,
            },
          },
          {
            path: "gamecategorylist",
            component: () =>
              import("@/views/manage/gameM/gameCategoryList/index.vue"),
            meta: {
              title: "游戏分类",
              requiresAuth: true,
              isShowNav: true,
            },
          },
          {
            path: "gameranking",
            component: () =>
              import("@/views/manage/gameM/gameRanking/index.vue"),
            meta: {
              title: "游戏排行",
              requiresAuth: true,
              isShowNav: true,
            },
          },
        ],
      },
      {
        path: "postmanage",
        redirect: "/postmanage/postlist",
        component: () => import("@/views/manage/postM/index.vue"),
        meta: {
          title: "帖子管理",
          menu: "帖子管理列表目录",
          requiresAuth: true,
          isShowNav: true,
        },
        children: [
          {
            path: "postlist",
            component: () => import("@/views/manage/postM/postList/index.vue"),
            meta: { title: "帖子列表", requiresAuth: true, isShowNav: true },
          },
          {
            path: "postinfo/:id",
            component: () => import("@/views/manage/postM/postInfo/index.vue"),
            meta: { title: "帖子详情", requiresAuth: true, isShowNav: false },
          },
        ],
      },
      {
        path: "/ordermanage",
        component: () => import("@/views/manage/orderM/index.vue"),
        meta: { title: "订单管理", requiresAuth: true, isShowNav: true },
      },
      {
        path: "/miniomanage",
        component: () => import("@/views/manage/minioM/index.vue"),
        meta: { title: "MinIO存储管理", requiresAuth: true, isShowNav: true },
      },
      {
        path: "/client_end_manage",
        component: () => import("@/views/manage/clientEndM/index.vue"),
        meta: { title: "客户端管理", requiresAuth: true, isShowNav: true },
      },
      {
        /* 错误页面有一部分是用来解决 用户页面的，有一部分是用来解决 管理员页面的，后面需要自己根据实际情况进行调整 */
        path: "/errorpages",
        redirect: "/errorpages/403",
        component: () => import("@/views/error/index.vue"),
        meta: {
          title: "错误页",
          requiresAuth: true,
          menu: "错误页目录",
          isShowNav: true,
        },
        children: [
          {
            path: "403",
            component: () => import("@/views/error/403/index.vue"),
            meta: { title: "403", requiresAuth: true, isShowNav: true },
          },
          {
            path: "404",
            component: () => import("@/views/error/404/index.vue"),
            meta: { title: "404", requiresAuth: true, isShowNav: true },
          },
          {
            path: "500",
            component: () => import("@/views/error/500/index.vue"),
            meta: { title: "500", requiresAuth: true, isShowNav: true },
          },
        ],
      },
      {
        path: "/help",
        component: () => import("@/views/help/index.vue"),
        meta: { title: "帮助", requiresAuth: true, isShowNav: true },
      },
      {
        path: "/user-center",
        component: () => import("@/views/userCenter/index.vue"),
        meta: { title: "个人中心", requiresAuth: true, isShowNav: false },
      },
    ],
  },
  // {
  //   path: "/403",
  //   component: () => import("@/views/error/403/index.vue"),
  //   meta: { title: "403", requiresAuth: false, isShowNav: false },
  // },
  {
    path: "/:pathMatch(.*)*",
    component: () => import("@/views/error/404/index.vue"),
    meta: { title: "404", requiresAuth: false, isShowNav: false },
  },
  // {
  //   path: "/500",
  //   component: () => import("@/views/error/500/index.vue"),
  //   meta: { title: "500", requiresAuth: false, isShowNav: false },
  // },
];

export default routes;
